from rest_framework.response import Response
class APIResponse(Response):
    def __init__(self, code=100, msg='成功', status=200, headers={}, **kwargs):
        data = {'code': code, 'msg': msg}
        if kwargs:  # 只要kwargs不为空，统一都放到响应体中
            data.update(kwargs)
        super().__init__(data=data, status=status, headers=headers)
